package cc.comac.mom.service.impl;

import java.util.List;

import cc.comac.mom.bean.EquipMaintainPlanBean;
import cc.comac.mom.bean.EquipMaintainWorkOrderBean;
import cc.comac.mom.bean.ResultDev;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipMaintainWorkOrderService;
import cc.comac.mom.bean.EquipMaintainWorkOrder;
import cc.comac.mom.datahandlers.entity.EquipMaintainWorkOrderDataHandler;
import cc.comac.mom.util.ResultBean;
@RestController
@Transactional
public class EquipMaintainWorkOrderServiceImpl implements EquipMaintainWorkOrderService{

	@Autowired
	private EquipMaintainWorkOrderDataHandler equipMaintainWorkOrderDataHandler;
	
	@Override
	public ResultBean batchDeleteMaintainWorkOrder(@RequestBody List<EquipMaintainWorkOrder> list) {
		ResultBean batchDeleteMaintainWorkOrder = equipMaintainWorkOrderDataHandler.batchDeleteMaintainWorkOrder(list);
		return batchDeleteMaintainWorkOrder;
	}

	@Override
	public ResultBean updateBySomeField(@RequestBody EquipMaintainWorkOrder equipMaintainWorkOrder) {
		ResultBean updateBySomeField = equipMaintainWorkOrderDataHandler.updateBySomeField(equipMaintainWorkOrder);
		return updateBySomeField;
	}

	@Override
	public ResultBean selectBySomeField(@RequestBody EquipMaintainWorkOrderBean equipMaintainWorkOrder) {
		ResultBean resultBean = new ResultBean(true);
		ResultDev selectByFields = equipMaintainWorkOrderDataHandler.selectBySomeField(equipMaintainWorkOrder);
		resultBean.setObject(selectByFields);
		return resultBean;
	}

}
